#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int dominantIndex(int* nums, int numsSize) {
    int max = nums[0]; int i = 0; int max_order = 0;
    for (i = 1; i < numsSize; i++)
    {
        if (nums[i] > max)
        {
            max = nums[i];
            max_order = i;
        }
    }
    for (i = 0; i < numsSize; i++)
    {

        if (max < nums[i] * 2 && i != max_order)
        {
            return -1;
        }
    }
    return max_order;
}
int main()
{
    int arr[4] = { 3,6,1,0 };
    printf("%d",dominantIndex(arr, 4));
}